package com.vmj.instructions.math;

import com.vmj.instructions.base.NoOperandsInstruction;
import com.vmj.rtda.Frame;
import com.vmj.rtda.OperandStack;

/**
 * Created by yangshoujun on 2017/8/20 下午4:22.
 */
public class IAdd extends NoOperandsInstruction {

    @Override
    public void execute(Frame frame) {

        OperandStack stack = frame.getOperandStack();
        int v2 = stack.popInt();
        int v1 = stack.popInt();

        int result = v1 + v2;
        stack.pushInt(result);
    }
}
